﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CommonFunc;

public partial class Control_AddGuestOrder : System.Web.UI.UserControl
{
    MODEL.GuestOrder MGO = new MODEL.GuestOrder();

    BLL.GuestOrder BGO = new BLL.GuestOrder();

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Btn_Submit_Click(object sender, EventArgs e)
    {
        try
        {
            MGO.GO_Title = TB_Title.Text;
            MGO.GO_Name = TB_Name.Text;
            MGO.GO_Email = TB_Email.Text;
            MGO.GO_Tel = TB_Tel.Text;
            MGO.GO_ItemNumber = TB_Number.Text;   
            MGO.GO_Content = CommonFunction.CharConvert(TB_Content.Text);
            MGO.GO_IP = Request.ServerVariables["Remote_Addr"].ToString();
            MGO.GO_DateTime = DateTime.Now;

            BGO.Add(MGO);

            LB_AddGuestOrder.Text = "添加成功";

            TB_Content.Text = "";
            TB_Email.Text = "";
            TB_Name.Text = "";
            TB_Number.Text = "";
            TB_Tel.Text = "";
            TB_Title.Text = "";
        }
        catch (Exception ex)
        {
            LB_AddGuestOrder.Text = ex.Message;
        }
    }
}
